package wickethub.web.app;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;

public class WicketHubWebApplicationServer {

	public static void main(String[] args) {

        Server server = new Server();
        Connector connector = new SelectChannelConnector();
        connector.setPort(8080);
        connector.setHost("127.0.0.1");
        server.addConnector(connector);

        WebAppContext wac = new WebAppContext();
        wac.setContextPath("/");
        wac.setWar("src/main/webapp");
        server.setHandler(wac);
        server.setStopAtShutdown(true);
        
        try {
        	server.start();
        } catch (Exception e) {
        	System.out.println("Impossible to start Jetty server!");
        	System.exit(1);
        }
	}
}